
var btn= $('#button');
var num=60;
var timer;

btn.click(function(){
    $(this).attr('disabled',true);
btn.text(num+'s');
    timer=setInterval(function(){
        if(num<=1){
            clearInterval(timer);
            btn.text('获取验证码');
            btn.attr('disabled',false);
            num=60;

        }else{
            num--;
            btn.text(num+'s');
        }

    },1000);

});